using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace LWRSSReader
{
	public partial class Form4 : SkinableFormsLib.LWSkinableFormVariant
	{
		public Form4()
		{
			InitializeComponent();
			listView1.Items.Clear();

			if (Settings != null)
			{
				Program.UpdateItemList(Settings.Feeds, listView1);
			}
		}

		public Settings Settings
		{
			get
			{
				return Program.Settings;


			}
		}




		private void Form4_Load(object sender, EventArgs e)
		{
			lwTextBox1.LWShadowColor = Color.Black;
			toolTip1.SetToolTip(lwButton1, "Close");
			toolTip1.SetToolTip(lwButton2, "Settings");
			toolTip1.SetToolTip(lwButton3, "Switch UI");

		}

		private void lwButton1_Click(object sender, EventArgs e)
		{
			Close();
		}

		private void lwButton2_Click(object sender, EventArgs e)
		{
			Form2 f2 = new Form2();
			if (f2.ShowDialog(this) == DialogResult.OK)
			{
				//show aggregated feeds
				Program.UpdateItemList(Settings.Feeds, listView1);
			}
		}

		private void listView1_SelectedIndexChanged(object sender, EventArgs e)
		{
			if (listView1.SelectedItems.Count > 0 && listView1.SelectedItems [0] != null && listView1.SelectedItems [0].Tag is RssItemInfoStruct)
			{
				RssItemInfoStruct rssItemInfoStruct = (RssItemInfoStruct) listView1.SelectedItems [0].Tag;
				Program.DisplayCurrentMedia(rssItemInfoStruct, true, lwTextBox1);
			}
		}

		private void lwButton3_Click(object sender, EventArgs e)
		{
			Program.SwitchUI();
		}
	}
}